
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>创建并运行 Flutter 项目 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../chapter3/" />
    
    
    <link rel="prev" href="section3.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../chapter1/">
            
                <a href="../chapter1/">
            
                    
                    Flutter vs React Native
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="./">
            
                <a href="./">
            
                    
                    环境配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.2.1" data-path="section1.html">
            
                <a href="section1.html">
            
                    
                    前置依赖环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2.2" data-path="section2.html">
            
                <a href="section2.html">
            
                    
                    配置 Android 环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2.3" data-path="section3.html">
            
                <a href="section3.html">
            
                    
                    配置 Flutter 环境
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.1.2.4" data-path="section4.html">
            
                <a href="section4.html">
            
                    
                    创建并运行 Flutter 项目
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="../chapter3/">
            
                <a href="../chapter3/">
            
                    
                    核心Widget的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.1" data-path="../chapter3/section3.html">
            
                <a href="../chapter3/section3.html">
            
                    
                    MaterialApp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.2" data-path="../chapter3/section1.html">
            
                <a href="../chapter3/section1.html">
            
                    
                    Text
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3" data-path="../chapter3/section2.html">
            
                <a href="../chapter3/section2.html">
            
                    
                    Center
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.4" data-path="../chapter3/section4.html">
            
                <a href="../chapter3/section4.html">
            
                    
                    Scaffold
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.5" data-path="../chapter3/section5.html">
            
                <a href="../chapter3/section5.html">
            
                    
                    常用的布局组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.6" data-path="../chapter3/section6.html">
            
                <a href="../chapter3/section6.html">
            
                    
                    AppBar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.7" data-path="../chapter3/section7.html">
            
                <a href="../chapter3/section7.html">
            
                    
                    TabBar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.8" data-path="../chapter3/section8.html">
            
                <a href="../chapter3/section8.html">
            
                    
                    TabController
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.9" data-path="../chapter3/section9.html">
            
                <a href="../chapter3/section9.html">
            
                    
                    TabBarView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.10" data-path="../chapter3/section10.html">
            
                <a href="../chapter3/section10.html">
            
                    
                    Drawer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.11" data-path="../chapter3/section11.html">
            
                <a href="../chapter3/section11.html">
            
                    
                    UserAccountsDrawerHeader
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.12" data-path="../chapter3/section12.html">
            
                <a href="../chapter3/section12.html">
            
                    
                    ListView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.13" data-path="../chapter3/section13.html">
            
                <a href="../chapter3/section13.html">
            
                    
                    CircleAvatar
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    自定义 Widget
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.4.1" data-path="../chapter4/section1.html">
            
                <a href="../chapter4/section1.html">
            
                    
                    StatelessWidget
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4.2" data-path="../chapter4/section2.html">
            
                <a href="../chapter4/section2.html">
            
                    
                    StatefulWidget
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.5" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    事件绑定
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    dio 数据请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.7" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    路由导航
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8" data-path="../chapter8/">
            
                <a href="../chapter8/">
            
                    
                    修改 App 名称和图标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.9" data-path="../chapter9/">
            
                <a href="../chapter9/">
            
                    
                    打包发布 Android 项目
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.10" data-path="../chapter10/">
            
                <a href="../chapter10/">
            
                    
                    项目中用到的资源
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >创建并运行 Flutter 项目</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x521B;&#x5EFA;&#x5E76;&#x8FD0;&#x884C;-flutter-&#x9879;&#x76EE;">&#x521B;&#x5EFA;&#x5E76;&#x8FD0;&#x884C; Flutter &#x9879;&#x76EE;</h1>
<h2 id="1-visual-studio-code-vs-code-&#x5B89;&#x88C5;">1. Visual Studio Code (VS Code) &#x5B89;&#x88C5;</h2>
<h3 id="11-&#x5B89;&#x88C5;-vs-code">1.1 &#x5B89;&#x88C5; VS Code</h3>
<p>&#x4E0B;&#x8F7D;&#x5E76;&#x5B89;&#x88C5;1.20.1&#x6216;&#x66F4;&#x9AD8;&#x7248;&#x672C;&#x7684; <a href="https://code.visualstudio.com/" target="_blank">VS Code</a>.</p>
<h3 id="12-&#x4E3A;-vs-code-&#x5B89;&#x88C5;-flutter-&#x63D2;&#x4EF6;">1.2 &#x4E3A; VS Code &#x5B89;&#x88C5; Flutter &#x63D2;&#x4EF6;</h3>
<ol>
<li><p>&#x542F;&#x52A8; VS Code</p>
</li>
<li><p>&#x8C03;&#x7528; <strong>&#x67E5;&#x770B;&gt;&#x547D;&#x4EE4;&#x9762;&#x677F;</strong></p>
</li>
<li><p>&#x8F93;&#x5165; <code>install</code>, &#x7136;&#x540E;&#x9009;&#x62E9; <strong>Extensions: Install Extension</strong></p>
</li>
<li><p>&#x5728;&#x641C;&#x7D22;&#x6846;&#x8F93;&#x5165; <code>flutter</code> , &#x5728;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x5217;&#x8868;&#x4E2D;&#x9009;&#x62E9; &#x2018;Flutter&#x2019;, &#x7136;&#x540E;&#x70B9;&#x51FB; <strong>Install</strong></p>
</li>
<li><p>&#x9009;&#x62E9; &#x2018;OK&#x2019; &#x91CD;&#x65B0;&#x542F;&#x52A8; VS Code</p>
</li>
</ol>
<h3 id="13-&#x901A;&#x8FC7;flutter-doctor&#x9A8C;&#x8BC1;-vs-code-&#x662F;&#x5426;&#x5B89;&#x88C5;&#x914D;&#x7F6E;&#x6210;&#x529F;">1.3 &#x901A;&#x8FC7;<code>flutter doctor</code>&#x9A8C;&#x8BC1; VS Code &#x662F;&#x5426;&#x5B89;&#x88C5;&#x914D;&#x7F6E;&#x6210;&#x529F;</h3>
<ol>
<li><p>&#x8C03;&#x7528; <strong>&#x67E5;&#x770B;&gt;&#x547D;&#x4EE4;&#x9762;&#x677F;</strong></p>
</li>
<li><p>&#x8F93;&#x5165; &#x2018;doctor&#x2019;, &#x7136;&#x540E;&#x9009;&#x62E9; <strong>Flutter: Run Flutter Doctor</strong></p>
</li>
<li><p>&#x67E5;&#x770B;&#x201C;OUTPUT&#x201D;&#x7A97;&#x53E3;&#x4E2D;&#x7684;&#x8F93;&#x51FA;&#x662F;&#x5426;&#x6709;&#x95EE;&#x9898;</p>
</li>
</ol>
<h2 id="2-&#x521B;&#x5EFA;-flutter-&#x9879;&#x76EE;">2. &#x521B;&#x5EFA; flutter &#x9879;&#x76EE;</h2>
<ol>
<li><p>&#x5728; VS Code &#x9762;&#x677F;&#x4E2D;&#xFF0C;&#x6309;&#x4E0B;&#x5FEB;&#x6377;&#x952E; <strong>Ctrl + Shift + P</strong> &#x6253;&#x5F00;&#x547D;&#x4EE4;&#x9762;&#x677F;</p>
</li>
<li><p>&#x5728;&#x547D;&#x4EE4;&#x9762;&#x677F;&#x4E2D;&#x8F93;&#x5165; <strong>flutter</strong></p>
</li>
<li><p>&#x9009;&#x62E9; <strong>flutter: New Project</strong> &#x9009;&#x9879;&#x521B;&#x5EFA;&#x65B0;&#x9879;&#x76EE;</p>
</li>
<li><p>&#x9009;&#x62E9;&#x9879;&#x76EE;&#x5B58;&#x653E;&#x76EE;&#x5F55;&#x540E;&#xFF0C;&#x521A;&#x624D;&#x6267;&#x884C;&#x7684;&#x547D;&#x4EE4;&#x4F1A;&#x81EA;&#x52A8;&#x521B;&#x5EFA; Flutter &#x9879;&#x76EE;</p>
</li>
</ol>
<h2 id="3-&#x8FD0;&#x884C;-flutter-&#x9879;&#x76EE;">3. &#x8FD0;&#x884C; flutter &#x9879;&#x76EE;</h2>
<ol>
<li><p>&#x8FD0;&#x884C; <code>flutter devices</code> &#x547D;&#x4EE4;&#x67E5;&#x770B;&#x662F;&#x5426;&#x6709;android&#x8BBE;&#x5907;&#x8FDE;&#x63A5;&#x5230;&#x5F53;&#x524D;&#x7535;&#x8111;&#x4E0A;</p>
</li>
<li><p>&#x5982;&#x679C;&#x663E;&#x793A;&#x5DF2;&#x6709;&#x5B89;&#x5353;&#x8BBE;&#x5907;&#x8FDE;&#x63A5;&#x5230;&#x5F53;&#x524D;&#x7535;&#x8111;&#xFF0C;&#x5219;&#x8FD0;&#x884C; <code>flutter run</code> &#x547D;&#x4EE4;&#xFF0C;&#x5373;&#x53EF;&#x628A;&#x9879;&#x76EE;&#x4EE5; debug &#x8C03;&#x8BD5;&#x6A21;&#x5F0F;&#x8FD0;&#x884C;&#x4E8E;&#x5B89;&#x5353;&#x8BBE;&#x5907;&#x4E4B;&#x4E0A;</p>
</li>
</ol>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x5982;&#x679C;&#x8FD0;&#x884C; <code>flutter devices</code> &#x547D;&#x4EE4;&#x65E0;&#x6CD5;&#x67E5;&#x770B;&#x5230;&#x5DF2;&#x8FDE;&#x63A5;&#x7684;&#x5B89;&#x5353;&#x8BBE;&#x5907;&#xFF0C;&#x5219;&#x6309;&#x6B65;&#x9AA4;&#x914D;&#x7F6E;&#x624B;&#x673A;&#xFF0C;&#x5F00;&#x542F;&#x5F00;&#x53D1;&#x8005;&#x6A21;&#x5F0F;&#xFF1A;</p>
<ol>
<li><p>&#x9700;&#x8981;&#x5B89;&#x88C5; <code>Android 4.1&#xFF08;API level 16&#xFF09;</code> &#x6216; <code>&#x66F4;&#x9AD8;&#x7248;&#x672C;</code> &#x7684;Android&#x8BBE;&#x5907;</p>
</li>
<li><p>&#x5728;&#x60A8;&#x7684;&#x8BBE;&#x5907;&#x4E0A;&#x542F;&#x7528; <strong>&#x5F00;&#x53D1;&#x4EBA;&#x5458;&#x9009;&#x9879;</strong> &#x548C; <strong>USB&#x8C03;&#x8BD5;</strong> &#x3002;&#x8BE6;&#x7EC6;&#x8BF4;&#x660E;&#x53EF;&#x5728; <a href="https://developer.android.com/studio/debug/dev-options.html" target="_blank">Android&#x6587;&#x6863;</a> &#x4E2D;&#x627E;&#x5230;&#x3002;</p>
</li>
<li><p>&#x4F7F;&#x7528;USB&#x5C06;&#x624B;&#x673A;&#x63D2;&#x5165;&#x7535;&#x8111;&#x3002;&#x5982;&#x679C;&#x60A8;&#x7684;&#x8BBE;&#x5907;&#x51FA;&#x73B0;&#x63D0;&#x793A;&#xFF0C;&#x8BF7;&#x6388;&#x6743;&#x60A8;&#x7684;&#x8BA1;&#x7B97;&#x673A;&#x8BBF;&#x95EE;&#x60A8;&#x7684;&#x8BBE;&#x5907;&#x3002;</p>
</li>
<li><p>&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#xFF0C;&#x8FD0;&#x884C; <code>flutter devices</code> &#x547D;&#x4EE4;&#x4EE5;&#x9A8C;&#x8BC1;Flutter&#x8BC6;&#x522B;&#x60A8;&#x8FDE;&#x63A5;&#x7684;Android&#x8BBE;&#x5907;&#x3002;</p>
</li>
</ol>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="section3.html" class="navigation navigation-prev " aria-label="Previous page: 配置 Flutter 环境">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../chapter3/" class="navigation navigation-next " aria-label="Next page: 核心Widget的使用">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"创建并运行 Flutter 项目","level":"1.1.2.4","depth":3,"next":{"title":"核心Widget的使用","level":"1.1.3","depth":2,"path":"chapter3/README.md","ref":"chapter3/README.md","articles":[{"title":"MaterialApp","level":"1.1.3.1","depth":3,"path":"chapter3/section3.md","ref":"chapter3/section3.md","articles":[]},{"title":"Text","level":"1.1.3.2","depth":3,"path":"chapter3/section1.md","ref":"chapter3/section1.md","articles":[]},{"title":"Center","level":"1.1.3.3","depth":3,"path":"chapter3/section2.md","ref":"chapter3/section2.md","articles":[]},{"title":"Scaffold","level":"1.1.3.4","depth":3,"path":"chapter3/section4.md","ref":"chapter3/section4.md","articles":[]},{"title":"常用的布局组件","level":"1.1.3.5","depth":3,"path":"chapter3/section5.md","ref":"chapter3/section5.md","articles":[]},{"title":"AppBar","level":"1.1.3.6","depth":3,"path":"chapter3/section6.md","ref":"chapter3/section6.md","articles":[]},{"title":"TabBar","level":"1.1.3.7","depth":3,"path":"chapter3/section7.md","ref":"chapter3/section7.md","articles":[]},{"title":"TabController","level":"1.1.3.8","depth":3,"path":"chapter3/section8.md","ref":"chapter3/section8.md","articles":[]},{"title":"TabBarView","level":"1.1.3.9","depth":3,"path":"chapter3/section9.md","ref":"chapter3/section9.md","articles":[]},{"title":"Drawer","level":"1.1.3.10","depth":3,"path":"chapter3/section10.md","ref":"chapter3/section10.md","articles":[]},{"title":"UserAccountsDrawerHeader","level":"1.1.3.11","depth":3,"path":"chapter3/section11.md","ref":"chapter3/section11.md","articles":[]},{"title":"ListView","level":"1.1.3.12","depth":3,"path":"chapter3/section12.md","ref":"chapter3/section12.md","articles":[]},{"title":"CircleAvatar","level":"1.1.3.13","depth":3,"path":"chapter3/section13.md","ref":"chapter3/section13.md","articles":[]}]},"previous":{"title":"配置 Flutter 环境","level":"1.1.2.3","depth":3,"path":"chapter2/section3.md","ref":"chapter2/section3.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chapter2/section4.md","mtime":"2018-12-09T16:33:56.379Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-12-17T10:25:33.898Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

